<?php
/*
Description: This file is used to edit venue inventory.
*/
#########IncludeFiles####################################################################################
include_once '../inc/config.php';
include_once("../inc/bootstrape.php");
require_once _SITE_PATH_.'classes/Venue/Venue.php';
require_once _SITE_PATH_.'classes/CommonUtility/CommonUtility.php';

$id = trim($_REQUEST['id']); 
if( $_POST['submit']=='Submit'){
	$parms['id'] = $_POST['id'];    
    $parms['venue_id'] = $_POST['venue'];
    $parms['start_date'] = $_POST['start_date'];
    $parms['end_date'] = $_POST['end_date'];
    $parms['added'] = date("Y-m-d H:i:s");
    
    $condition = array(); 
	$condition['id'] = $parms['id'];  
    if(CommonUtility::updateData($parms, 'venue_inventory', $condition)) {        
        header("Location: venueinventory_mng.php?msg=1766");            
        exit;
    }
    $err = 1767;    
}

$venueinventories = array();
$venueinventories = Venue::getVenueInventories($id);
$result = $venueinventories[0];

$errMsg = $err;
$_tplName = 'venue/venueinventory_edit.tpl';
$_title = 'Edit Venue Inventory';

//  calender js include
$_extraJS[] = _SITE_URL_ . 'lib/calender/js/cal.js';
require_once _ADMIN_TPL_MAIN_;
?>